Clean up subarch 'mach-foo' header files. No need for
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 3 Apr 2006 16:47:42 +0000 (17:47 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 3 Apr 2006 16:47:42 +0000 (17:47 +0100)
subarch apicdef.h and ipi.h can be much simplified.

Signed-off-by: Keir Fraser <keir@xensource.com>
24 files changed:
xen/arch/x86/genapic/bigsmp.c
xen/arch/x86/genapic/default.c
xen/arch/x86/genapic/es7000.c
xen/arch/x86/genapic/probe.c
xen/arch/x86/genapic/summit.c
xen/arch/x86/smp.c
xen/include/asm-x86/apicdef.h
xen/include/asm-x86/genapic.h
xen/include/asm-x86/mach-bigsmp/mach_apicdef.h [deleted file]
xen/include/asm-x86/mach-bigsmp/mach_ipi.h [deleted file]
xen/include/asm-x86/mach-default/mach_apic.h
xen/include/asm-x86/mach-default/mach_apicdef.h [deleted file]
xen/include/asm-x86/mach-default/mach_ipi.h [deleted file]
xen/include/asm-x86/mach-default/mach_mpspec.h [new file with mode: 0644]
xen/include/asm-x86/mach-es7000/mach_apicdef.h [deleted file]
xen/include/asm-x86/mach-es7000/mach_ipi.h [deleted file]
xen/include/asm-x86/mach-es7000/mach_wakecpu.h [deleted file]
xen/include/asm-x86/mach-generic/mach_apicdef.h [deleted file]
xen/include/asm-x86/mach-generic/mach_ipi.h [deleted file]
xen/include/asm-x86/mach-generic/mach_mpspec.h [deleted file]
xen/include/asm-x86/mach-summit/mach_apicdef.h [deleted file]
xen/include/asm-x86/mach-summit/mach_ipi.h [deleted file]
xen/include/asm-x86/mach_ipi.h [new file with mode: 0644]
xen/include/asm-x86/smp.h

index 61b594a4097794f7fa9c415045014303a4648816..4338e5765e2d7a32475ab36502f4cfb49568b69b 100644 (file)
@@ -2,7 +2,6 @@
  * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
  * Drives the local APIC in "clustered mode".
  */
-#define APIC_DEFINITION 1
 #include <xen/config.h>
 #include <xen/cpumask.h>
 #include <asm/current.h>
@@ -14,9 +13,8 @@
 #include <xen/smp.h>
 #include <xen/init.h>
 #include <xen/dmi.h>
+#include <asm/mach_ipi.h>
 #include <asm/mach-bigsmp/mach_apic.h>
-#include <asm/mach-bigsmp/mach_apicdef.h>
-#include <asm/mach-bigsmp/mach_ipi.h>
 #include <asm/mach-default/mach_mpparse.h>
 
 static int dmi_bigsmp; /* can be set by dmi scanners */
@@ -52,4 +50,7 @@ static __init int probe_bigsmp(void)
        return dmi_bigsmp; 
 } 
 
-struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp); 
+struct genapic apic_bigsmp = {
+       APIC_INIT("bigsmp", probe_bigsmp),
+       .send_ipi_mask = send_IPI_mask_sequence
+};
index d84cf4114186fd909623e91ce483e592ae07bd54..a7403922bb65bb1e31adab4d47222f983bcb3491 100644 (file)
@@ -1,12 +1,10 @@
 /* 
  * Default generic APIC driver. This handles upto 8 CPUs.
  */
-#define APIC_DEFINITION 1
 #include <xen/config.h>
 #include <xen/cpumask.h>
 #include <asm/current.h>
 #include <asm/mpspec.h>
-#include <asm/mach-default/mach_apicdef.h>
 #include <asm/genapic.h>
 #include <asm/fixmap.h>
 #include <asm/apicdef.h>
@@ -14,8 +12,8 @@
 #include <xen/string.h>
 #include <xen/smp.h>
 #include <xen/init.h>
+#include <asm/mach_ipi.h>
 #include <asm/mach-default/mach_apic.h>
-#include <asm/mach-default/mach_ipi.h>
 #include <asm/mach-default/mach_mpparse.h>
 
 /* should be called last. */
@@ -24,4 +22,7 @@ static __init int probe_default(void)
        return 1;
 } 
 
-struct genapic apic_default = APIC_INIT("default", probe_default); 
+struct genapic apic_default = {
+       APIC_INIT("default", probe_default),
+       .send_ipi_mask = send_IPI_mask_bitmask
+};
index 05e94b0f046676e9d58c643f5f176e3ea7033055..37c959bf4cb57ab12000fd4c96f5a95aa5a61ee8 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * APIC driver for the Unisys ES7000 chipset.
  */
-#define APIC_DEFINITION 1
 #include <xen/config.h>
 #include <xen/cpumask.h>
 #include <asm/current.h>
 #include <xen/string.h>
 #include <xen/smp.h>
 #include <xen/init.h>
-#include <asm/mach-es7000/mach_apicdef.h>
+#include <asm/mach_ipi.h>
 #include <asm/mach-es7000/mach_apic.h>
-#include <asm/mach-es7000/mach_ipi.h>
 #include <asm/mach-es7000/mach_mpparse.h>
-#include <asm/mach-es7000/mach_wakecpu.h>
 
 static __init int probe_es7000(void)
 {
@@ -26,4 +23,7 @@ static __init int probe_es7000(void)
        return 0;
 }
 
-struct genapic apic_es7000 = APIC_INIT("es7000", probe_es7000);
+struct genapic apic_es7000 = {
+       APIC_INIT("es7000", probe_es7000),
+       .send_ipi_mask = send_IPI_mask_sequence
+};
index cddde7a45986834e8273b0dc9415d387b359923e..4b1d375b1d228b1b496066b6e5b5ac6d5a1b7929 100644 (file)
@@ -103,8 +103,3 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        } 
        return 0;       
 }
-
-int hard_smp_processor_id(void)
-{
-       return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
-}
index 28a47f09decce2ca977173665925d17086ee5a01..acf191acfc34e6d8ceeafe3f31fdefcb584311d7 100644 (file)
@@ -1,7 +1,6 @@
 /* 
  * APIC driver for the IBM "Summit" chipset.
  */
-#define APIC_DEFINITION 1
 #include <xen/config.h>
 #include <xen/cpumask.h>
 #include <asm/current.h>
@@ -13,9 +12,8 @@
 #include <xen/string.h>
 #include <xen/smp.h>
 #include <xen/init.h>
+#include <asm/mach_ipi.h>
 #include <asm/mach-summit/mach_apic.h>
-#include <asm/mach-summit/mach_apicdef.h>
-#include <asm/mach-summit/mach_ipi.h>
 #include <asm/mach-summit/mach_mpparse.h>
 
 static __init int probe_summit(void)
@@ -24,4 +22,7 @@ static __init int probe_summit(void)
        return 0;
 } 
 
-struct genapic apic_summit = APIC_INIT("summit", probe_summit); 
+struct genapic apic_summit = {
+       APIC_INIT("summit", probe_summit),
+       .send_ipi_mask = send_IPI_mask_sequence
+};
index 18240da6f5b43d74376137436e4efce1a057cdc1..f94ad00517c16d04c4806770e9656808216fc616 100644 (file)
@@ -20,8 +20,8 @@
 #include <asm/flushtlb.h>
 #include <asm/smpboot.h>
 #include <asm/hardirq.h>
+#include <asm/mach_ipi.h>
 #include <mach_apic.h>
-#include <mach_ipi.h>
 
 /*
  *     Some notes on x86 processor bugs affecting SMP operation:
@@ -119,7 +119,7 @@ void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
     local_irq_restore(flags);
 }
 
-inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
+void send_IPI_mask_sequence(cpumask_t mask, int vector)
 {
     unsigned long cfg, flags;
     unsigned int query_cpu;
index 402b2a9da590398421a9e309eedff505abfcec38..81bb2b84cb7ee24336a731fd617ec07d797e90a8 100644 (file)
@@ -11,6 +11,9 @@
 #define                APIC_DEFAULT_PHYS_BASE  0xfee00000
  
 #define                APIC_ID         0x20
+#define                        APIC_ID_MASK            (0xFFu<<24)
+#define                        GET_APIC_ID(x)          (((x)>>24)&0xFFu)
+#define                        SET_APIC_ID(x)          (((x)<<24))
 #define                APIC_LVR        0x30
 #define                        APIC_LVR_MASK           0xFF00FF
 #define                        GET_APIC_VERSION(x)     ((x)&0xFF)
index 2c7fa476f302182ca9865bc3264caf3a85340ff4..751e1dfc28fb54a0f1fc6d87ca5465a66548aa79 100644 (file)
@@ -49,16 +49,15 @@ struct genapic {
                              char *productid);
        int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
 
-       unsigned (*get_apic_id)(unsigned long x);
        unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
        
        /* ipi */
-       void (*send_IPI_mask)(cpumask_t mask, int vector);
+       void (*send_ipi_mask)(cpumask_t mask, int vector);
 }; 
 
 #define APICFUNC(x) .x = x
 
-#define APIC_INIT(aname, aprobe) \
+#define APIC_INIT(aname, aprobe) \
        .name = aname, \
        .probe = aprobe, \
        .int_delivery_mode = INT_DELIVERY_MODE, \
@@ -79,13 +78,10 @@ struct genapic {
        APICFUNC(apicid_to_cpu_present), \
        APICFUNC(check_phys_apicid_present), \
        APICFUNC(mps_oem_check), \
-       APICFUNC(get_apic_id), \
        APICFUNC(cpu_mask_to_apicid), \
        APICFUNC(acpi_madt_oem_check), \
-       APICFUNC(send_IPI_mask), \
        APICFUNC(enable_apic_mode), \
-       APICFUNC(phys_pkg_id), \
-       }
+       APICFUNC(phys_pkg_id)
 
 extern struct genapic *genapic;
 
diff --git a/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h b/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h
deleted file mode 100644 (file)
index 4842ed8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-       return (((x)>>24)&0xFF);
-} 
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/xen/include/asm-x86/mach-bigsmp/mach_ipi.h b/xen/include/asm-x86/mach-bigsmp/mach_ipi.h
deleted file mode 100644 (file)
index c487589..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
index b1c76fe27bc80965f1d1603592bd2fe8f1286832..c673ae24bb9fd05154f3aa46bc0820ed7f08fede 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __ASM_MACH_APIC_H
 #define __ASM_MACH_APIC_H
 
-#include <mach_apicdef.h>
 #include <asm/smp.h>
 
 #define APIC_DFR_VALUE (APIC_DFR_FLAT)
diff --git a/xen/include/asm-x86/mach-default/mach_apicdef.h b/xen/include/asm-x86/mach-default/mach_apicdef.h
deleted file mode 100644 (file)
index db8c923..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-       return (((x)>>24)&0xF);
-} 
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/xen/include/asm-x86/mach-default/mach_ipi.h b/xen/include/asm-x86/mach-default/mach_ipi.h
deleted file mode 100644 (file)
index 069f16c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_bitmask(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
-       send_IPI_mask_bitmask(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
diff --git a/xen/include/asm-x86/mach-default/mach_mpspec.h b/xen/include/asm-x86/mach-default/mach_mpspec.h
new file mode 100644 (file)
index 0000000..9ef0b94
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __ASM_MACH_MPSPEC_H
+#define __ASM_MACH_MPSPEC_H
+
+#define MAX_IRQ_SOURCES 256
+
+/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
+/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
+#define MAX_MP_BUSSES 260
+
+#endif /* __ASM_MACH_MPSPEC_H */
diff --git a/xen/include/asm-x86/mach-es7000/mach_apicdef.h b/xen/include/asm-x86/mach-es7000/mach_apicdef.h
deleted file mode 100644 (file)
index 4842ed8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-       return (((x)>>24)&0xFF);
-} 
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/xen/include/asm-x86/mach-es7000/mach_ipi.h b/xen/include/asm-x86/mach-es7000/mach_ipi.h
deleted file mode 100644 (file)
index c487589..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
diff --git a/xen/include/asm-x86/mach-es7000/mach_wakecpu.h b/xen/include/asm-x86/mach-es7000/mach_wakecpu.h
deleted file mode 100644 (file)
index d43e0b6..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef __ASM_MACH_WAKECPU_H
-#define __ASM_MACH_WAKECPU_H
-
-/* 
- * This file copes with machines that wakeup secondary CPUs by the
- * INIT, INIT, STARTUP sequence.
- */
-
-#ifdef CONFIG_ES7000_CLUSTERED_APIC
-#define WAKE_SECONDARY_VIA_MIP
-#else
-#define WAKE_SECONDARY_VIA_INIT
-#endif
-
-#ifdef WAKE_SECONDARY_VIA_MIP
-extern int es7000_start_cpu(int cpu, unsigned long eip);
-static inline int
-wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
-{
-       int boot_error = 0;
-       boot_error = es7000_start_cpu(phys_apicid, start_eip);
-       return boot_error;
-}
-#endif
-
-#define TRAMPOLINE_LOW maddr_to_virt(0x467)
-#define TRAMPOLINE_HIGH maddr_to_virt(0x469)
-
-#define boot_cpu_apicid boot_cpu_physical_apicid
-
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-#ifdef WAKE_SECONDARY_VIA_INIT
-       while (!atomic_read(deassert));
-#endif
-       return;
-}
-
-/* Nothing to do for most platforms, since cleared by the INIT cycle */
-static inline void smp_callin_clear_local_apic(void)
-{
-}
-
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-#if APIC_DEBUG
- #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
-#else
- #define inquire_remote_apic(apicid) {}
-#endif
-
-#endif /* __ASM_MACH_WAKECPU_H */
diff --git a/xen/include/asm-x86/mach-generic/mach_apicdef.h b/xen/include/asm-x86/mach-generic/mach_apicdef.h
deleted file mode 100644 (file)
index 78eada8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _GENAPIC_MACH_APICDEF_H
-#define _GENAPIC_MACH_APICDEF_H 1
-
-#ifndef APIC_DEFINITION
-#include <asm/genapic.h>
-
-#define GET_APIC_ID (genapic->get_apic_id)
-#endif
-
-#endif
diff --git a/xen/include/asm-x86/mach-generic/mach_ipi.h b/xen/include/asm-x86/mach-generic/mach_ipi.h
deleted file mode 100644 (file)
index 06bfd75..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _MACH_IPI_H
-#define _MACH_IPI_H 1
-
-#include <asm/genapic.h>
-
-#define send_IPI_mask (genapic->send_IPI_mask)
-
-#endif
diff --git a/xen/include/asm-x86/mach-generic/mach_mpspec.h b/xen/include/asm-x86/mach-generic/mach_mpspec.h
deleted file mode 100644 (file)
index 9ef0b94..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_MACH_MPSPEC_H
-#define __ASM_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
-/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
-#define MAX_MP_BUSSES 260
-
-#endif /* __ASM_MACH_MPSPEC_H */
diff --git a/xen/include/asm-x86/mach-summit/mach_apicdef.h b/xen/include/asm-x86/mach-summit/mach_apicdef.h
deleted file mode 100644 (file)
index 4842ed8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x) 
-{ 
-       return (((x)>>24)&0xFF);
-} 
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/xen/include/asm-x86/mach-summit/mach_ipi.h b/xen/include/asm-x86/mach-summit/mach_ipi.h
deleted file mode 100644 (file)
index c487589..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
diff --git a/xen/include/asm-x86/mach_ipi.h b/xen/include/asm-x86/mach_ipi.h
new file mode 100644 (file)
index 0000000..20936c8
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_MACH_IPI_H
+#define __ASM_MACH_IPI_H
+
+#include <asm/genapic.h>
+
+void send_IPI_mask_bitmask(cpumask_t mask, int vector);
+void send_IPI_mask_sequence(cpumask_t mask, int vector);
+
+#define send_IPI_mask (genapic->send_ipi_mask)
+
+#endif /* __ASM_MACH_IPI_H */
index f05c5feb0e38f8fdcf1faf0d0f78d4bed81817dd..f23b9158734a9967d5b3cf44cabb1a945bda4ba0 100644 (file)
@@ -74,16 +74,11 @@ static inline int num_booting_cpus(void)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-#ifdef APIC_DEFINITION
-extern int hard_smp_processor_id(void);
-#else
-#include <mach_apicdef.h>
 static inline int hard_smp_processor_id(void)
 {
        /* we don't want to mark this access volatile - bad code generation */
        return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
 }
-#endif
 
 static __inline int logical_smp_processor_id(void)
 {